﻿using Aribaccio;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BDPAutodetect.Models
{
    public partial class MRoleDto : ObservableModel
    {
        /// <summary>
        /// ID编号
        /// </summary>
        public int ID { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [ObservableProperty]
        protected string name;

        /// <summary>
        /// 超级状态(默认0非超级状态，1超级状态)
        /// </summary>
        [ObservableProperty]
        protected int supered;

        /// <summary>
        /// 构造函数
        /// </summary>
        public MRoleDto()
        { 
            this.Name = string.Empty;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public MRoleDto(int argID, string argName, int argSupered = 0)
        {
            this.ID = argID;
            this.Name = argName;
            this.Supered = argSupered;
        }

        /// <summary>
        /// 深度克隆
        /// </summary>
        /// <returns></returns>
        public MRoleDto CloneDeep()
        {
            return new MRoleDto(this.ID, this.Name, this.Supered);
        }

        /// <summary>
        /// 克隆数据表
        /// </summary>
        /// <returns></returns>
        public TBasicRole CloneTData()
        {
            return new TBasicRole()
            {
                ID = this.ID,
                Name = this.Name,
                Supered = this.Supered
            };
        }
    }
}
